package com.tbsoft.ehr.model;

import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * 服务客户信息
 * @author lizhenhua
 *
 */
@Entity
@Table(name="EHR_SERVICECUSTOMER")
public class ServiceCustomer extends BaseEntity implements Comparable<ServiceCustomer> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String id;
	private String name;
	private String desc;
	/**
	 * 服务工时
	 */
	private BigDecimal workingHour;

	public ServiceCustomer(){
		
	}
	public ServiceCustomer(String id){		
		this.id = id;
	}
	@Id
	@GeneratedValue(generator="system-uuid")
	@GenericGenerator(name="system-uuid", strategy = "uuid")
	@Column(name="SC_ID")
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}
	@Column(name="SC_NAME",nullable=false,length=50,unique=true)
	public String getName() {
		return name.trim();
	}

	public void setName(String name) {
		this.name = name;
	}
	
	@Column(name="WORKING_HOUR",precision=5,scale=2)
	public BigDecimal getWorkingHour() {
		return workingHour;
	}
	public void setWorkingHour(BigDecimal workingHour) {
		this.workingHour = workingHour;
	}
	@Column(name="SC_DESC",length=250)
	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
	@Override
	public int compareTo(ServiceCustomer o) {
		return this.getName().compareTo(o.getName());
	}

}
